package com.my.zidingyikongjian.activity;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;

import com.my.zidingyikongjian.R;

public class DrawTextActivity extends AppCompatActivity implements View.OnClickListener {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_draw_text);

        initView();
    }

    private void initView() {
        findViewById(R.id.btn_simple_text).setOnClickListener(this);
        findViewById(R.id.btn_left_text).setOnClickListener(this);
        findViewById(R.id.btn_center_text).setOnClickListener(this);
        findViewById(R.id.btn_right_text).setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.btn_simple_text:
                goIntent("1");
                break;
            case R.id.btn_left_text:
                goIntent("2");
                break;
            case R.id.btn_center_text:
                goIntent("3");
                break;
            case R.id.btn_right_text:
                goIntent("4");
                break;
        }
    }

    private void goIntent(String flag) {
        Intent intent = new Intent(DrawTextActivity.this, FiveActivity.class);
        intent.putExtra("five", flag);
        startActivity(intent);
    }
}
